﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core
{
    public partial class Aspnet_Role
    {
        public static IQueryable<Aspnet_Role> LoadSearchResult(string roleName)
        {
            DataAccessDataContext db = new DataAccessDataContext();
            IQueryable<Aspnet_Role> roles = from r in db.Aspnet_Roles
                                            orderby r.RoleName ascending
                                            select r;

            if (!string.IsNullOrEmpty(roleName))
            {
                roles = from r1 in roles
                        where r1.RoleName.Contains(roleName)
                        orderby r1.RoleName ascending
                        select r1;
            }

            return roles;
        }
    }
}
